package com.real.operationalcontrols.登陆;

import android.content.Intent;
import android.os.Bundle;

import com.real.operationalcontrols.MainActivity;
import com.real.operationalcontrols.R;
import com.real.operationalcontrols.基类.BaseActivity;
import com.white.easysp.EasySP;

public class SplashActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_splash;
    }

    @Override
    protected void getData() {
        //判断是否是首次安装还是覆盖安装
//        int version = EasySP.init(this).getInt("version", 0);
//        EasySP.init(this).putInt("version", AppUtils.getAppVersionCode());
//        if (version != 0 && version != AppUtils.getAppVersionCode()) {
//            EasySP.init(this).clear();
//        }

        boolean isFirst = EasySP.init(this).getBoolean("isFirst", true);
        if (isFirst) {
            Intent intent2 = new Intent(this, LoginActivity.class);
            startActivity(intent2);
            finish();
        } else {
            Intent intent2 = new Intent(this, MainActivity.class);
            startActivity(intent2);
            finish();
        }
    }
}
